package sort

type OrderByEnum int

const (
	// OrderByAsc 升序
	OrderByAsc OrderByEnum = 0
	// OrderByDesc 降序
	OrderByDesc OrderByEnum = 1
)

func (o OrderByEnum) GetCompareFunc() func(i, j int32) bool {
	switch o {
	case OrderByAsc:
		return Bigger
	default:
		return Smaller
	}
}

func Bigger(i, j int32) bool {
	if i > j {
		return true
	}
	return false
}

func Smaller(i, j int32) bool {
	if i < j {
		return true
	}
	return false
}
